<html>
<head>

	<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>

    	<title>Question</title>

    	<link rel="stylesheet" type="text/css" href="style.css"/>


<?php 
include("function.php");
extract($_POST);

$qstat = stopQuiz($class_uid, $quiz_uid);

$a = strtolower($answer);

$url = "http://146.95.30.80:9998/quiz/$quiz_uid/answers";

$result = curl_Get($url);	
$r_a = json_decode($result, true);

$b = strtolower($r_a[0]["description"]);


function check() {
	global $a;
	global $b;
	if($a == $b) {
		print "CORRECT";
	}	
	else {
		print "WRONG";
	}
}
?>
</head>
<body>

	<div id="container">
		<?php
			/*******Header*******/
			include("header.php");
		?>	

	 <div id="wrapper">
            <div id="content">
		<h2>Question</h2>
		<? echo "<h3>$qstat</h3>";?>
		<? echo "<h2>" . $_POST["quest"] . "</h2>"; ?>
		Your Answer: <? echo $a . ". " . $_POST[$a]; ?> </br>
		Correct Answer: <? echo $b . "."; ?> </br>
		<?check();?>
		
	   </div>
	</div>

		<?php
			/***Side Navigation***/
			include("sidebar.php");

			/****Extra Content***/
			include("extra.php");

			/*******Footer*******/
			include("footer.php"); 
		?>
		
	</div>		
	
</body>
</html>			
		
